//
//  LightEntity.m
//  SuperLight
//
//  Created by Charlie Liao on 14-4-29.
//  Copyright (c) 2014年 Charlie Liao. All rights reserved.
//

#define kIsSelect      @"kIsSelect"
#define kName          @"kName"
#define kAddr          @"kAddr"

#import "LightEntity.h"

@implementation LightEntity

- (id)initWithName:(NSString*)name AndAddr:(NSString*)addr
{
    self = [super init];
    if (self) {
        self.name = name;
        self.addr = addr;
        self.isSelect = NO;
    }
    return self;
}

#pragma mark   NsCoding

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.name forKey:kName];
    [aCoder encodeObject:self.addr forKey:kAddr];
    [aCoder encodeBool:self.isSelect forKey:kIsSelect];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [self initWithName:[aDecoder decodeObjectForKey:kName] AndAddr:[aDecoder decodeObjectForKey:kAddr]];
    self.isSelect = [aDecoder decodeBoolForKey:kIsSelect];
    return self;
}


@end
